{% extends 'layouts/public.html' %}
{% load static i18n %}

{% block title %}{{ translation.title }}{% endblock title %}

{% block content %}
<style>
  .ck-content {
    font-size: 1.1rem;
  }

  .ck-content h1, .ck-content h2, .ck-content h3 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: bold;
  }

  .ck-content p {
    margin-bottom: 1rem;
  }

  .ck-content ul,
  .ck-content ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
  }

  .ck-content blockquote {
    padding-left: 1rem;
    border-left: 4px solid var(--gold);
    font-style: italic;
    color: #666;
  }

  .ck-content img {
    max-width: 100%;
    height: auto;
    margin: 1rem 0;
    border-radius: 8px;
  }

  .ck-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
  }

  .ck-content th, .ck-content td {
    border: 1px solid #ccc;
    padding: 0.5rem;
    text-align: left;
  }
</style>

<div class="container mt-5 mb-5">
  <div class="row justify-content-center">
    <div class="col-lg-10">

      <h1 class="fw-bold mb-4" style="color: var(--gold);">
        {{ translation.title }}
      </h1>

      {% if news.image %}
        <img src="{{ news.image.url }}" class="img-fluid rounded mb-4" alt="{{ translation.title }}">
      {% endif %}

      <div class="mb-4 ck-content">
        {{ translation.content|safe }}
      </div>

      <p class="text-muted">
        <small>
          {% trans "Autor" %}: {{ news.author.username }} |
          {% trans "Publicado em" %}: {{ news.pub_date|date:"d/m/Y H:i" }}
        </small>
      </p>

    </div>
  </div>
</div>
{% endblock content %}
